﻿using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
using XLua;

namespace Point24
{
    public class LuaManager : MonoBehaviour
    {
        public LuaEnv luaenv = null;

        private void Awake()
        {
            luaenv = new LuaEnv();
            luaenv.AddLoader((ref string filename) =>
            {
                filename = filename.Replace('.', '/') + ".lua";
                filename = Application.dataPath + "/Lua/" + filename;
                if (File.Exists(filename))
                {
                    return File.ReadAllBytes(filename);
                }
                else {
                    return null;
                }
            });
        }
        // Use this for initialization
        void Start()
        {
        }

        // Update is called once per frame
        void Update()
        {

        }
    }
}